<script setup lang="ts">

import { ref } from 'vue';

type cloth = {
  id: string
  name: string
  price: number
}

// 1.ref函数加类型
const clothList = ref<cloth[]>([
  { id: '1001', name: '男士鞋子', price: 280 },
  { id: '1002', name: '男士卫衣', price: 180 }
])

</script>

<template>
  <div>
    <ul>
      <li v-for="item in clothList" :key="item.id">
        序号:{{ item.id }},名称:{{ item.name }},价格:{{ item.price }}
      </li>
    </ul>
  </div>
</template>

<style scoped></style>
